﻿/*
 * Created by SharpDevelop.
 * User: Administrator
 * Date: 2016/4/21
 * Time: 11:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using SharpChannel.Rpc.Proxy;

namespace SharpChannel.Test
{
	/// <summary>
	/// Description of TestProy.
	/// </summary>
	public class TestProxy
	{
		
		public interface ICal{
			
			int add(int a, int b);
			
			int sub(int a, int b);
		}
		
		public class Proxy : IProxyHandler{
			
		#region IProxyHandler implementation
		public object Invoke(System.Reflection.MethodInfo method, object[] args)
		{
			return  99;
		}
		
		#endregion
			
		}
		
		public static void Main1(String[] args){
			var proxy = new SharpChannel.Rpc.Proxy.ProxyGenerator<ICal>(new Proxy()).GetProxyObject();
			Console.WriteLine(proxy.add(1, 2));
			Console.WriteLine(proxy.add(1, 2));
			Console.ReadKey();
		}
	}
}
